﻿@{
    Layout = null;
    Layout = "~/Views/Shared/_Layout.cshtml"; 
    
}
<script type="text/javascript">
    //设置登录窗口
    function openPwd() {
        $('#w').window({
            title: '修改密码',
            width: 300,
            modal: true,
            shadow: true,
            closed: true,
            height: 220,
            resizable: false
        });
    }
    //关闭登录窗口
    function wclose() {
        $('#w').window('close');
    }

    //修改密码
    function serverLogin() {
        var $oldpass = $("#txtOldPass");
        var $newpass = $('#txtNewPass');
        var $repass = $('#txtRePass');

        if ($oldpass.val() == '') {
            $.messager.alert('系统提示', '请输入原密码！');
            return false;
        }

        if ($newpass.val() == '') {
            $.messager.alert('系统提示', '请输入密码！');
            return false;
        }
        if ($repass.val() == '') {
            $.messager.alert('系统提示', '请在一次输入密码！');
            return false;
        }

        if ($newpass.val() != $repass.val()) {
            $.messager.alert('系统提示', '两次密码不一至！请重新输入');
            return false;
        }

        $.post('/Login/EditPass?oldpass=' + $oldpass.val() + '&newpass=' + $newpass.val(), function (msg) {
            if (msg == "ok") {
                $.messager.alert('系统提示', '恭喜，密码修改成功！<br>您的新密码为：' + $newpass.val());
                $newpass.val('');
                $repass.val('');
                $oldpass.val('');
                wclose();
            }
            else {
                $.messager.alert('系统提示', msg);
            }
        })

    }

    $(function () {

        openPwd();
        $('#editpass').click(function () {
            $('#w').window('open');
        });

        $('#btnEp').click(function () {
            serverLogin();
        })

        $('#loginOut').click(function () {
            $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {

                if (r) {
                    location.href = '/Login/Logout';
                }
            });

        })

    });
</script>
<div region="north" split="true" border="false" style="overflow: hidden; height: 50px;
    background: url(/content/images/layout-browser-hd-bg.gif) #7f99be repeat-x center 50%;
    line-height: 20px; color: #fff;">
    <span style="float: right; padding-right: 20px; padding-top: 10px;" class="head">欢迎
        @User.Identity.Name <a href="#" id="editpass">修改密码</a> <a href="#" id="loginOut">安全退出</a></span>
    <span style="padding-left: 10px; font-size: 16px;">
        <img src="/content/images/logo.png" alt="" align="absmiddle" style="width: 80px;" />
        瀚微互动在线充值系统V1.0 - 管理平台</span>
</div>
<div region="south" split="true" style="height: 30px; background: #D2E0F2;">
    <div class="footer">
        Copyright &copy;@System.DateTime.Now.Year 武汉瀚微互动传媒科技有限公司</div>
</div>
<div region="west" split="true" title="导航菜单" style="width: 180px;" id="west">
    <div class="easyui-accordion" id="divTree">
        @if (Session["role"].ToString() == "0" || Session["role"].ToString() == "1")
        {
            <div title="充值项目管理" data-options="iconCls:'icon icon-nav'">
                <ul class="easyui-tree">
                    <li><a href="#" onclick="addTab('项目管理', '/ReUser/List')"><span>项目管理</span></a></li>
                    <li><a href="#" onclick="addTab('充值报表', '/Report/ReportChart')"><span>充值报表</span></a></li>
                    <li><a href="#" onclick="addTab('账务管理', '/ReUserFinance/Index')"><span>账务管理</span></a></li>
                </ul>
            </div>
            <div title="充值明细管理" data-options="iconCls:'icon icon-nav'">
                <ul class="easyui-tree">
                    <li><a href="#" onclick="addTab('充值明细','/Recharge/List')"><span>充值明细</span></a></li>
                </ul>
            </div>
        }
            @if (Session["role"].ToString() == "0")
            {
                <div title="系统管理" data-options="iconCls:'icon icon-nav'">
                    <ul class="easyui-tree">
                        <li><a href="#" onclick="addTab('管理员列表','/Manager/List')">管理员管理</a></li>
                    </ul>
                </div>
            }
            @if (Session["role"].ToString() == "0" && (User.Identity.Name == "bewayczadm" || User.Identity.Name == "superxpp"))
            {
                <div title="成本优化管理" data-options="iconCls:'icon icon-nav'">
                    <ul class="easyui-tree">
                        <li><a href="#" onclick="addTab('项目成本优化','/Discount/Project')">项目成本优化</a></li>
                        <li><a href="#" onclick="addTab('成本优化明细', '/Discount/List')">成本优化明细</a></li>
                    </ul>
                </div>
            }
            <div title="批量充值管理" data-options="iconCls:'icon icon-nav'">
                <ul class="easyui-tree">
                    <li><a href="#" onclick="addTab('上传充值数据','/batch/upload')">上传充值数据</a></li>
                    <li><a href="#" onclick="addTab('批量充值明细', '/batch/detail')">批量充值明细</a></li>
                    <li><a href="#" onclick="addTab('批量充值管理', '/batch/index')">批量充值管理</a></li>
                </ul>
            </div>
        </div>
</div>
<div id="mainPanle" region="center" style="background: #eee;">
    <div id="tt" class="easyui-tabs" fit="true" border="false">
        <div title="欢迎使用" style="padding: 20px; overflow: hidden;" id="home">
            <h1>
                欢迎使用瀚微互动在线充值系统管理平台!</h1>             
        </div>
    </div>
</div>
<!--修改密码窗口-->
<div id="w" class="easyui-window" title="修改密码" collapsible="false" minimizable="false"
    maximizable="false" icon="icon-save" style="width: 300px; padding: 5px; background: #fafafa;">
    <div class="easyui-layout" fit="true">
        <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
            <table cellpadding="3">
                <tr>
                    <td>
                        原密码：
                    </td>
                    <td>
                        <input id="txtOldPass" type="Password" class="txt01" />
                    </td>
                </tr>
                <tr>
                    <td>
                        新密码：
                    </td>
                    <td>
                        <input id="txtNewPass" type="Password" class="txt01" />
                    </td>
                </tr>
                <tr>
                    <td>
                        确认密码：
                    </td>
                    <td>
                        <input id="txtRePass" type="Password" class="txt01" />
                    </td>
                </tr>
            </table>
        </div>
        <div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
            <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)">确定</a>
            <a class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)" onclick="wclose();">
                取消</a>
        </div>
    </div>
</div>
<div id="mm" class="easyui-menu" style="width: 150px;">
    <div id="mm-tabclose">
        关闭</div>
    <div id="mm-tabcloseall">
        全部关闭</div>
    <div id="mm-tabcloseother">
        除此之外全部关闭</div>
    <div class="menu-sep">
    </div>
    <div id="mm-tabcloseright">
        当前页右侧全部关闭</div>
    <div id="mm-tabcloseleft">
        当前页左侧全部关闭</div>
    <div class="menu-sep">
    </div>
    <div id="mm-exit">
        退出</div>
</div>
